home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 30 / PC Gamer IT CD 30 1-2.iso / MOTS / GAMEDATA / RESOURCE / JKMRES.GOO / cog_pow_health.cog < prev    next >
Text File  |  1998-02-25  |  1KB  |  70 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # POW_HEALTH.COG
  4. #
  5. # POWERUP Script - Health
  6. #
  7. # [YB & CYW]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. sound       pickupsnd=helthpu1.wav           local
  17. sound       respawnsnd=Activate01.wav        local
  18. flex        amount                           local
  19.  
  20. message     touched
  21. message     taken
  22. message     respawn
  23.  
  24. end
  25.  
  26. # ========================================================================================
  27.  
  28. code
  29.  
  30. touched:
  31.    player = GetSourceRef();
  32.    amount = GetHealth(player);
  33.  
  34.    if ((amount > 0) && (amount < 100))
  35.    {
  36.       TakeItem(GetSenderRef(), -1);
  37.       call taken;
  38.    }
  39.  
  40.    Return;
  41.  
  42. # ........................................................................................
  43.  
  44. taken:
  45.    player = GetSourceRef();
  46.    powerup = GetSenderRef();
  47.  
  48.    // Print("Health Pack");
  49.    jkPrintUNIString(player, 201);
  50.  
  51.    // Do effects.
  52.    PlaySoundLocal(pickupsnd, 1, 0, 0);
  53.    AddDynamicTint(player, 0.0, 0.0, 0.2);
  54.  
  55.    // Do the healing.
  56.    HealThing(player, 20.0);
  57.  
  58.    Return;
  59.  
  60. # ........................................................................................
  61.  
  62. respawn:
  63.    PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
  64.  
  65.    Return;
  66.  
  67. end
  68.  
  69.  
  70.